<script type="text/javascript">
  jQ("div.price_container #quantity_available").html("<%= quantity %>").effect("highlight");
  jQ("#cart_hd #cart_total_items").effect("highlight");
  if(<%= quantity%> == 0){
    jQ("#add_to_cart_button").replaceWith("<div>Sorry, this item is sold out!</div>");
  }
</script>